﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLLA
{
    class Program
    {
        static void Main(string[] args)
        {
            WxPayData req = new WxPayData();
            //req.SetValue("transaction_id", "4200000070201804266113355118");
            req.SetValue("out_trade_no", "2562");
            if (WxPayConfig.sfg)
            {
                req.SetValue("sub_mch_id", WxPayConfig.SUB_MCHID);//子商户号
            }
            bool z = false;
            WxPayData res = WxPayApi.OrderQuery(req);
            if (res.GetValue("return_code").ToString() == "SUCCESS" && res.GetValue("result_code").ToString() == "SUCCESS")
                z = true;
        }
        private bool QueryOrder(string transaction_id)
        {
            WxPayData req = new WxPayData();
            req.SetValue("transaction_id", transaction_id);
            if (WxPayConfig.sfg)
            {
                req.SetValue("sub_mch_id", WxPayConfig.SUB_MCHID);//子商户号
            }
            WxPayData res = WxPayApi.OrderQuery(req);
            if (res.GetValue("return_code").ToString() == "SUCCESS" &&
                res.GetValue("result_code").ToString() == "SUCCESS")
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
 
}
